Learn R Programming

xdvir (version 0.1-2)

fontspec Package: LaTeX Package fontspec.

Description

Define a LaTeXPackage for the LaTeX fontspec package.

Usage

fontspecPackage(font=NULL, name=font)

Value

A "LaTeXpackage" object.

Arguments

font

The name of a font to use as the main font. See details.

name

The name of the resulting package.

Author

Paul Murrell

Details

This function creates a "LaTeXpackage" object that provides support for the LaTeX fontspec package.

The font argument provides some convenience for setting the main font to be used. The font can be the common name of a system font or a complete path to the font file.

For more complex situations, fontspec commands can be added to the LaTeX code that is sent to functions like author and grid.latex (see the Examples).

A predefined package, with no main font defined, is pre-registered under the name "fontspec".

Examples

Run this code
cat(author("test", packages="fontspec"), sep="\n")
cat(author("test", packages=fontspecPackage(font="Courier")), sep="\n")
tex <- "\\setmainfont{fontname.ttf}[Path=/path/to/font/]\ntest"
cat(author(tex, packages="fontspec"), sep="\n")

Run the code above in your browser using DataLab